package fr.adfm.entity;

//import java.util.List;

//import javax.persistence.DiscriminatorColumn;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
//import javax.persistence.OneToMany;
import javax.persistence.InheritanceType;
import javax.persistence.NamedQuery;

@Entity
//@Inheritance
//@DiscriminatorColumn(name="MEMBRE_TYPE")
@Inheritance(strategy=InheritanceType.JOINED)
@NamedQuery(name="membre.QueryMembreByEmail",  
query="select o from Membre o where o.email = :emailSaisie")
public abstract class Membre implements java.io.Serializable {

public static String BY_EMAIL = "membre.QueryMembreByEmail";

	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue
	private long membreId;
	private String motDePasse;
	
	@Column(unique=true)
	private String email;
	
	@Enumerated(EnumType.STRING)
    private Profil profil;
	

	public long getMembreId() {
		return membreId;
	}

	public void setMembreId(long membreId) {
		this.membreId = membreId;
	}
	public String getMotDePasse() {
		return motDePasse;
	}
	public void setMotDePasse(String motDePasse) {
		this.motDePasse = motDePasse;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Membre() {	}

	public Membre(String motDePasse, String email) {
		this.motDePasse = motDePasse;
		this.email = email;
	}

	public Profil getProfil() {
		return profil;
	}

	public void setProfil(Profil profil) {
		this.profil = profil;
	}


	
}
